# -*-encoding: utf-8 -*-

import redis

class TokenCache:
    pool = redis.ConnectionPool(host='localhost', port=16379, password='lczgywzyy', db=2)

    def __init__(self):
        self.cache = redis.Redis(connection_pool=self.pool)
        print  '[Connection][CACHE][TOKENCACHE][FINISHED]'

    def addCache(self, tel, token):
        return self.cache.set(tel, token)
    def getCache(self, tel):
        return self.cache.get(tel)
